package day12.lx;

import java.io.*;
import java.util.Arrays;

public class Lian10 {
    public static void main(String[] args) throws IOException {
        BufferedReader br=new BufferedReader(new FileReader("jinjie\\b.txt"));
        String line=br.readLine();
        System.out.println("读取到的数据是"+line);
        br.close();
        String[] s = line.split(" ");
        int[]arr=new int[s.length];
        for (int i = 0; i < s.length; i++) {
            String smallstr = s[i];
            int number = Integer.parseInt(smallstr);
            arr[i]=number;
        }
        Arrays.sort(arr);
        System.out.println(Arrays.toString(arr));
        BufferedWriter bw=new BufferedWriter(new FileWriter("jinjie\\b.txt"));
        for (int i = 0; i < arr.length; i++) {
            bw.write(arr[i]+" ");
            bw.flush();

        }
        bw.close();
    }
}
